#!/usr/bin/perl

use Tk;
use strict;
use warnings;

# variables
my %drawing = ('xmin'  => undef,
	       'xmax'  => undef,
	       'ymin'  => undef,
               'ymax'  => undef,
               'lines' => [ ]);


#gui
my $mw;                                          # main window
my $can;                                         # drawing canvas
my $left_frame;                                  # left frame with buttons

my $draw_button;                                 # 

# start
$mw = new MainWindow (-title => "Test no. 4");

# create the left frame with draw buttons
$left_frame = $mw -> Frame();

# create a button for drawing lines
my $b_draw = $left_frame -> Button(-text => 'line');
$b_draw -> grid(-row => 0, -column => 0);

# a button for deleting lines
my $b_delete = $left_frame -> Button(-text => 'delete');
$b_delete -> grid(-row => 1, -column => 0);


my $b_zoom = $left_frame -> Button(-text => 'zoom');
$b_zoom -> grid(-row => 2, -column => 0);

my $snap_endpoints = 0;
my $cb_snap_endpoints = $left_frame -> Checkbutton(-text => 'snap ends',
                                                   -variable => \&snap_endpoints);

$cb_snap_endpoints -> grid(-row => 3, -column => 0);

$left_frame -> pack (-side => 'left', -anchor => 'n');

# create the drawing canvas
$can = $mw -> Canvas(-width => 800, -height => 600,
                     -background =>'black',
                     -cursor     => 'dot');
$can -> pack(-side => 'right');


# create callbacks




MainLoop();

